package s01;

import base.Sample;
import net.sf.cglib.proxy.Enhancer;

/**
 * @author wangpp
 */
public class SampleTest {

    public static void main(String[] args) {
        System.setProperty("cglib.debugLocation", "target/cglib");
        Enhancer enhancer = new Enhancer();

        enhancer.setSuperclass(Sample.class);
        enhancer.setCallback(new SampleMethodInterceptor());

        Sample sample = (Sample) enhancer.create();
        sample.test();

        System.out.println(sample.getClass());

    }
}
